<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>订单详情</title>
    <script th:src="@{/layui/layui.js}" type="text/javascript"></script>
    <link th:href="@{/layui/css/layui.css}" rel="stylesheet" />
</head>
<body>
<style>

</style>
<div class="layui-container">
    <form class="layui-form">
        <input name="id" th:value="${order.id}" type="hidden">
        <input id="commodityId" th:value="${order.commodityId}" type="hidden">

        <div class="layui-form-item">
            <label class="layui-form-label">会员名称</label>
            <div class="layui-input-block">
                <input  class="layui-input"  type="text" name="member" style="width: 250px;" th:value="${order.member}"/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">下单时间</label>
            <div class="layui-input-block">
                <input  class="layui-input"  type="text" name="orderTime" style="width: 350px;" th:value="${#dates.format(order.orderTime,'yyyy-MM-dd hh:mm:ss')}"/>
            </div>
        </div>
        <div class="layui-form-item">
           <table id="commodityTable"></table>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">订单状态</label>
            <div class="layui-input-block">
                <input  class="layui-input"  type="text" name="state" style="width: 250px;" th:value="${order.state}"/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">订单金额</label>
            <div class="layui-input-block">
                <input  class="layui-input"  type="text" name="orderAmount" style="width: 250px;" th:value="${order.orderAmount}"/>
            </div>

        </div>

        <div class="layui-form-item" >
            <label class="layui-form-label">实付金额</label>
            <div class="layui-input-block">
            <input class="layui-input"  readonly type="text" name="paidinAmount" th:value="${order.paidinAmount}"  />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">支付时间</label>
            <div class="layui-input-block">
                <input class="layui-input" name="aymentTime" type="text" th:value="${#dates.format(order.aymentTime,'yyyy-MM-dd hh:mm:ss')}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">收货人</label>
            <div class="layui-input-block">
                <input class="layui-input" name="consignee" type="text" th:value="${order.consignee}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">物流单号</label>
            <div class="layui-input-block">
                <input class="layui-input" name="oddNumbers" type="text" th:value="${order.oddNumbers}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">物流渠道</label>
            <div class="layui-input-block">
                <input class="layui-input" name="channel" type="text" th:value="${order.channel}">
            </div>
        </div>



        <div class="layui-form-item">
            <a class="layui-btn" style="display: none;">提交</a>
        </div>

    </form>
</div>
<script>
    var $,ids;
    layui.use(['layer','table','jquery'],function () {
        var layer = layui.layer, table = layui.table;
        $ = layui.jquery;
       getid();
        table.render({
            elem: '#commodityTable',
            height: 'full-160',
            page: true,
            url: '/system/ct/findCommodity?ids='+ids,
            cols: [
                [

                    {field: 'name', title: '商品名称', width: 150},
                    {field: 'category', title: '商品类目', width: 100},
                    {field: 'img', title: '图片', width: 80, templet: '#photo', align: 'center'},
                    {field: 'marketPrice', title: '市场售价', width: 100},
                    {field: 'price', title: '当前售价', width: 100}

                ]
            ]
        })
        function getid(){
            ids=$('#commodityId').val();
            if(ids!=undefined&&ids!=null&&!$.isEmptyObject(ids)) {
                ids = JSON.parse(ids);
            }else{
                ids=0;
            }

        }
    })
</script>
</body>
</html>
